package com.jye.rseven.user.serivce.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.jye.rseven.domain.PtGoods;
import com.jye.rseven.service.PtGoodsService;
import com.jye.rseven.user.mapper.PtGoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class PtGoodsServiceImpl implements PtGoodsService {
    @Autowired
    PtGoodsMapper ptGoodsMapper;


    @Override
    public int addPtGoods(PtGoods ptGoods) {
        try{
            ptGoodsMapper.addPtGoods(ptGoods);
                return 1;
           }catch (Exception e){
                return 0;
            }
        }

    @Override
    public List<PtGoods> findPtGoods(int skip, int limit) {
        List<PtGoods> list = ptGoodsMapper.findPtGoods(skip, limit);
        return list;
    }

    @Override
    public PtGoods findPtGodsById(int id) {
        return ptGoodsMapper.findPtGodsById(id);
    }

    @Override
    public List<PtGoods> findPtGoodsByName(String ptGoodsName) {
        List<PtGoods> list = ptGoodsMapper.findPtGoodsByName(ptGoodsName);
        return list;
    }
}

